$(function() {
	$("#pic_hide").click(function() {
		var dataPath = $("#dataPath").val();
		var carrierPath = $("#carrierPath").val();
		var resultPath_hide = $("#resultPath_hide").val();
		if (dataPath == '') {
			$("#dataPath").focus();
			notifyMsg('请输入要隐藏的数据文件路径');
			return;
		}
		if (carrierPath == '') {
			$("#carrierPath").focus();
			notifyMsg('请输入载体图片路径');
			return;
		}
		if (resultPath_hide == '') {
			$("#resultPath_hide").focus();
			notifyMsg('请输入隐藏后的图片路径');
			return;
		}
		$.ajax({
			type: "POST",
			url: "http://127.0.0.1:8080/lsp/picHide",
			dataType: "json",
			data: {
				"dataPath": dataPath,
				"carrierPath": carrierPath,
				"resultPath": resultPath_hide
			},
			xhrFields: {
				withCredentials: true
			},
			success: function(data) {
				notifyMsg(data.msg);
			}
		})
	})

	$("#pic_show").click(function() {
		var resultPath_show = $("#resultPath_show").val();
		var dataPath_show = $("#dataPath_show").val();
		if (resultPath_show == '') {
			$("#resultPath_show").focus();
			notifyMsg('请输入隐藏后的图片路径');
			return;
		}
		if (dataPath_show == '') {
			$("#dataPath_show").focus();
			notifyMsg('请输入导出数据文件路径');
			return;
		}
		$.ajax({
			type: "POST",
			url: "http://127.0.0.1:8080/lsp/picShow",
			dataType: "json",
			data: {
				"resultPath": resultPath_show,
				"dataPath": dataPath_show
			},
			xhrFields: {
				withCredentials: true
			},
			success: function(data) {
				notifyMsg(data.msg);
			}
		})
	})
});
